<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/Home/layui/css/layui.css">
  <link rel="stylesheet" href="__PUBLIC__/Home/css/global.css">
  <block name='link'>
  	
  </block>
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="{:U('Index/index')}">
      <img src="__PUBLIC__/Home/images/logo.png" alt="layui">
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
      <li class="layui-nav-item ">
        <a href="{:U('Index/index')}"><i class="iconfont icon-shouye"></i>首页</a>
      </li>
      <li class="layui-nav-item <block name='nav2'></block>">
        <a href="{:U('About/index')}"><i class="iconfont icon-iconmingxinganli"></i>关于我</a>
      </li>
      <li class="layui-nav-item <block name='nav3'></block>">
        <a href="{:U('Mood/index')}"><i class="iconfont icon-jiaoliu"></i>碎言碎语</a>
      </li>
      <li class="layui-nav-item <block name='nav4'></block>">
        <a href="{:U('Article/index')}"><i class="iconfont icon-wenda"></i>学无止境</a>
      </li>
      <li class="layui-nav-item <block name='nav5'></block>">
        <a href="{:U('User/msg')}"><i class="iconfont icon-renshu"></i>留言板</a>
      </li>
    </ul>
    
    <block name='login'>
    <ul class="layui-nav fly-nav-user">
    	<if condition="$Think.session.userid eq ''">
      <!-- 未登入的状态 -->
      <li class="layui-nav-item">
        <a class="iconfont icon-touxiang layui-hide-xs" href="{:U('User/login')}"></a>
      </li>
      <li class="layui-nav-item">
        <a href="{:U('User/login')}">登入</a>
      </li>
      <li class="layui-nav-item">
        <a href="{:U('User/register')}">注册</a>
      </li>
      <else />
      <!-- 登入后的状态 -->
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="{:U('User/personal', array('id'=> session('userid')))}">
          <cite class="layui-hide-xs">{$Think.session.username}</cite>
          <i class="iconfont icon-renzheng layui-hide-xs" title=""></i>
          <img src="__PUBLIC__/Admin/images/{$Think.session.img}">
        </a>
        <dl class="layui-nav-child">
          <dd><a href="{:U('User/logout')}" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
      </if>
    </ul>
  </div>
  </block>
</div>


<div class="fly-panel fly-column">
  <div class="layui-container">
    <ul class="layui-clear">
    </ul>
    <div class="fly-column-right layui-hide-xs">
      <span class="fly-search"><i class="layui-icon"></i></span>
      <a href="##" class="layui-btn">发表新帖</a>
    </div>
    <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
      <a href="##" class="layui-btn">发表新帖</a>
    </div>
  </div>
</div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <block name='main'>
    <div class="layui-col-md8">
	<literal>
    <div class="fly-panel">
      <div class="fly-panel-title fly-filter" style="padding: 0; height: 278px;">
        <div class="layui-carousel" id="test1">
          <div>
            <div><img style="height: 278px; width: 100%;" src="__PUBLIC__/Home/images/slide1.jpg"/></div>
          </div>
        </div>
      </div>
    </div>
    </literal>

    <div class="fly-panel" style="margin-bottom: 0;">
      <div class="fly-panel-title fly-filter">
        <a>最新发布</a>
      </div>

      <ul class="fly-list">
        <!--<li>
          <a href="user/home.html" class="fly-avatar">
            <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt="贤心">
          </a>
          <h2>
            <a class="layui-badge">动态</a>
            <a href="jie/detail.html">基于 layui 的极简社区页面模版</a>
          </h2>
          <div class="fly-list-info">
            <a href="user/home.html" link>
              <cite>贤心</cite>
              <i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
              <i class="layui-badge fly-badge-vip">VIP3</i>
            </a>
            <span>刚刚</span>

            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>
            <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
            <span class="fly-list-nums">
              <i class="iconfont icon-pinglun1" title="回答"></i> 66
            </span>
          </div>
          <div class="fly-list-badge">
            <span class="layui-badge layui-bg-red">精帖</span>
          </div>
        </li>-->

        
        <foreach name='article' item='v'>
        	
        <li>
          <a href="user/home.html" class="fly-avatar">
            <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt="user">
          </a>
          <h2>
            <a class="layui-badge">动态</a>
            <a href="{:U('Article/detail',array('id'=>$v['id']))}">{$v['title']}</a>
          </h2>
          <div class="fly-list-info">
            <a href="user/home.html" link>
              <cite>{$v['author']}</cite>
            </a>
            <span>{$v['insert_at']}</span>
            <span class="fly-list-nums">
              	<i class="iconfont icon-liulanyanjing" title="浏览"></i> {$v['click_num']}
              	<php>$num = $reply->query("select count(*) count from reply where aid = ".$v['id']);</php>
                <i class="iconfont icon-pinglun1" title="回答"></i> {$num[0]['count']}
              </span>
          </div>
          <div class="fly-list-badge">
            <span class="layui-badge layui-bg-red">精帖</span>
          </div>
        </li>
        </foreach>
      </ul>

      <div style="text-align: center">
        <div class="laypage-main">
          <a href="{:U('Article/index')}" class="laypage-next">更多</a>
        </div>
      </div>
    </div>
  </div>
    </block>
    <block name='right'>
    <div class="layui-col-md4">

      <div class="fly-panel">
        <h3 class="fly-panel-title">博主信息</h3>
        <ul class="fly-panel-main fly-list-one">
        	<li>姓名： xxx</li>
        	<li>职业： web前端开发</li>
        	<li>邮箱： xxx@qq.com</li>
        	<li>定位： 杭州</li>
        </ul>
      </div>
      
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">热门推荐</dt>
        <if condition="count($hotList) lt 1">
        <div class="fly-none">没有相关数据</div>
        <else />
	        <foreach name='hotList' item='v'>
	        <dd>
	          <a href="{:U('Article/detail',array('id'=>$v['aid']))}">{$v['title']}</a>
	          <span><i class="iconfont icon-pinglun1"></i> {$v['count']}</span>
	        </dd>
	        </foreach>
		</if>
      </dl>
      
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">点击排行</dt>
        <if condition="count($hot) lt 1">
        <div class="fly-none">没有相关数据</div>
        <else />
	        <foreach name='hot' item='v'>
	        <dd>
	          <a href="{:U('Article/detail',array('id'=>$v['id']))}">{$v['title']}</a>
	          <span><i class="iconfont icon-liulanyanjing"></i> {$v['click_num']}</span>
	        </dd>
	        </foreach>
		</if>
      </dl>

      <div class="fly-panel fly-link">
        <h3 class="fly-panel-title">友情链接</h3>
        <dl class="fly-panel-main">
        	
          <dd><a href="##">百度</a><dd>
          <dd><a href="##">天猫</a><dd>
          <dd><a href="##">淘宝</a><dd>
          <dd><a href="##">京东</a><dd>
        </dl>
      </div>

      <div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
        <h3 class="fly-panel-title">最近访客</h3>
        <dl>
          <if condition="count($users) gt 0">
          <foreach name='users' item='v'>
          <dd>
            <a href="{:U('User/personal', array('id'=> $v['id']))}">
              <img src="__PUBLIC__/Admin/images/{$v['avatar']}"><cite>{$v['nickname']}</cite>
            </a>
          </dd>
          </foreach>
          <else />
          <dd>
            暂无访客
          </dd>
          </if>
        </dl>
      </div>
    </div>
    </block>
  </div>
</div>


<div class="fly-footer">
  
</div>
<block name='js'>
	
</block>
<script src="__PUBLIC__/Home/layui/layui.js"></script>
<script src="__PUBLIC__/Home/js/jquery-1.11.3.min.js"></script>
<script>
layui.cache.page = '';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '__PUBLIC__/Home/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};

layui.config({
    version: "3.0.0"
    ,base: '__PUBLIC__/Home/js/'
}).extend({
    fly: 'index'
}).use(['fly', 'face'], function(){
    var $ = layui.$
        ,fly = layui.fly;
    //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。
    /*
    $('.detail-body').each(function(){
      var othis = $(this), html = othis.html();
      othis.html(fly.content(html));
    });
    */
});

<block name='jscode'>
</block>

</script>

</body>
</html>